package com.dingreading.cloud.admin.controller;

import com.dingreading.cloud.admin.service.StoreProtectService;
import com.dingreading.cloud.common.base.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RefreshScope
@RestController
@RequestMapping("/system/storeProtect")
@Api(tags = "总部-门店保护范围管理")
public class StoresProtectController {

    @Resource
    private StoreProtectService storeProtectService;

    @ApiOperation(value = "获取全部门店的保护范围")
    @PostMapping(value = "/getAllStoreProtects", produces = "application/json; charset=UTF-8")
    public R<Object> getAllStoreProtects(
            @ApiParam(value = "总部员工uid") @RequestParam(value = "headStaffUid") String headStaffUid,
            @ApiParam(value = "总部员工名") @RequestParam(value = "headStaffName") String headStaffName
    ) {
        return storeProtectService.getAllStoreProtects();
    }

}